vault e2e: 11% test speedup by replacing fixed allowlist sleeps with on-demand retry#21707
Merged
prashantkumar1982 merged 1 commit intodevelopfrom Mar 25, 2026
Merged
vault e2e: 11% test speedup by replacing fixed allowlist sleeps with on-demand retry#21707prashantkumar1982 merged 1 commit intodevelopfrom
prashantkumar1982 merged 1 commit intodevelopfrom
Conversation
Remove the 6-second time.Sleep after every allowlistRequest() call (14 calls × 6s = 84s of forced sleep per test run). Instead, add retry logic in sendVaultRequestToGateway() that detects gateway-level "request not allowlisted" rejections and retries every 2s up to 7 times. Node-level rejections (where the gateway already consumed the request) are correctly distinguished and not retried. Measured improvement: total test time 500s → 446s (-11%).
Contributor
|
👋 prashantkumar1982, thanks for creating this pull request! To help reviewers, please consider creating future PRs as drafts first. This allows you to self-review and make any final changes before notifying the team. Once you're ready, you can mark it as "Ready for review" to request feedback. Thanks! |
Contributor
|
✅ No conflicts with other open PRs targeting |
vreff
approved these changes
Mar 25, 2026
|
jmank88
approved these changes
Mar 25, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.




Summary
Replace the fixed
time.Sleep(6s)after everyallowlistRequest()call with on-demand retry logic insendVaultRequestToGateway(). The test suite callsallowlistRequest()14 times per run, totaling 84 seconds of unconditional sleep. This PR eliminates that by retrying only when the gateway hasn't yet synced the allowlist.Changes
time.Sleep(6 * time.Second)fromallowlistRequest()inv2_vault_don_test.gosendVaultRequestToGateway()(v2_vault_don_test_helpers.go): if the gateway returns a "request not allowlisted" error, retry every 2s up to 7 timesisGatewayNotAllowlistedError()helper that correctly distinguishes gateway-level rejections (retryable:method="", code -32600) from node-level rejections (not retryable:methodis set, code -32603, gateway already consumed the request)Performance Results
Both runs used
workflow-gateway-capabilitiestopology on local CRE, same branch (develop), same hardware.basic_crudsubtestcross_namespacesubtestHow the retry works
Most requests need only 1–2 retries (2–4s wait) before the allowlist syncer propagates the on-chain data. A few need 3 retries (6s). The worst case (7 retries = 14s) is still better than the unconditional 6s sleep that was paid on every call.
Why gateway vs node distinction matters
When the allowlist syncer on the gateway has caught up but individual nodes haven't, the gateway accepts and forwards the request. If nodes reject it, the gateway has already "consumed" the authorization. Retrying would get "request already authorized previously". The
isGatewayNotAllowlistedError()function detects this by checking for the emptymethodfield in the JSON-RPC error response (gateway-level rejection) vs a populatedmethodfield (node-level rejection).